<?php 

if (empty($_GET['topic_id'])) die;

$topic_id = intval($_GET['topic_id']);

$topic = dt_query_one("SELECT id, title, forum_id FROM forum_topic WHERE id = $topic_id");
if (!$topic) die('获取topic数据失败！');
$forum = dt_query_one("SELECT id, name, kind, ext FROM forum WHERE id = ".$topic['forum_id']);
if (!$forum) die('获取forum数据失败！');

?>
<div class="container">
	<div class="row clearfix">
		<ol class="breadcrumb forum-breadcrumb">
			<li><a href="?c=forum"><span class="glyphicon glyphicon-home"></span> 首页</a></li>
			<?php if (0 != $forum['kind']) { ?>
			<li><a href="?c=forum&a=forum_list&m_falter=5&kind=<?php echo $forum['kind'] ?>"><img src="img/finance/hengxin_logo_sm_1.png" height="25px"> <?php echo dt_query_one("SELECT name FROM forum_kind WHERE id = ".$forum['kind'])['name'] ?></a></li>
			<?php } ?>
			<li><a href="?c=forum&a=topic_list&forum_id=<?php echo $forum['id'] ?>"><?php echo $forum['name'] ?></a></li>
			<li><a href="?c=forum&a=topic_show&topic_id=<?php echo $topic_id ?>"><?php echo $topic['title'] ?></a></li>
			<li class="active">下单</li>
		</ol>
	</div>
</div>
<div class="container">
	<div class="forum-add">
		<div class="row clearfix">
			<div class="col-md-12 column">
				<h3><span class="glyphicon glyphicon-edit"></span> 在 [<?php echo $topic['title'] ?>] 下单</h3>
				<hr class="solid">
				<div class="col-md-11 column">
					<form class="form-horizontal" id="do_topic_order_t" action="javascript:do_topic_order_t(<?php echo $topic_id ?>)">
						<fieldset>
							<!-- forum_id -->
							<input type="hidden" name="topic_id" value="<?php echo $topic_id ?>"/>
							<!-- Text input-->
							<div class="form-group">
								<label class="col-md-2 control-label">联系电话</label>  
								<div class="col-md-9">
									<input name="tel" type="text" placeholder="158-8888-8888" class="form-control input-md" required="">
								</div>
							</div>
							<input type="hidden" name="token" value="<?php echo get_token() ?>"/>
							<!-- Button -->
							<div class="form-group">
								<label class="col-md-2 control-label"></label>
								<div class="col-md-2">
									<button class="btn btn-primary btn-block">下单</button>
								</div>
								<div class="col-md-7">
									<a class="btn btn-success btn-block" type="button" href="javascript:jump_to_login('?c=forum&a=topic_show&topic_id=<?php echo $topic_id?>')">登录后下单</a>
								</div>
							</div>
						</fieldset>
					</form>	


				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">

$(document).ready(function(){
});

</script>
